<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-Hans" xml:lang="zh-Hans"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="generator" content="quarto-1.4.551">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<meta name="description" content="介绍使用相关工具对 LI-6800 和 LI-6400 光合数据进行分析的一些方法，主要以 R 为主， 有时候为方便或者作为比较，会涉及 python 和其他工具。">
<title>LI-6800 和 LI-6400 光合数据分析指南 - 22&nbsp; 气孔导度模型的拟合</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
  width: 0.8em;
  margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */ 
  vertical-align: middle;
}
/* CSS for syntax highlighting */
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
  { counter-reset: source-line 0; }
pre.numberSource code > span
  { position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
  { content: counter(source-line);
    position: relative; left: -1em; text-align: right; vertical-align: baseline;
    border: none; display: inline-block;
    -webkit-touch-callout: none; -webkit-user-select: none;
    -khtml-user-select: none; -moz-user-select: none;
    -ms-user-select: none; user-select: none;
    padding: 0 4px; width: 4em;
  }
pre.numberSource { margin-left: 3em;  padding-left: 4px; }
div.sourceCode
  {   }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
/* CSS for citations */
div.csl-bib-body { }
div.csl-entry {
  clear: both;
  margin-bottom: 0em;
}
.hanging-indent div.csl-entry {
  margin-left:2em;
  text-indent:-2em;
}
div.csl-left-margin {
  min-width:2em;
  float:left;
}
div.csl-right-inline {
  margin-left:2em;
  padding-left:1em;
}
div.csl-indent {
  margin-left: 2em;
}</style>

<script src="site_libs/quarto-nav/quarto-nav.js"></script>
<script src="site_libs/quarto-nav/headroom.min.js"></script>
<script src="site_libs/clipboard/clipboard.min.js"></script>
<script src="site_libs/quarto-search/autocomplete.umd.js"></script>
<script src="site_libs/quarto-search/fuse.min.js"></script>
<script src="site_libs/quarto-search/quarto-search.js"></script>
<meta name="quarto:offset" content="./">
<link href="./gm.html" rel="next">
<link href="./gm-gs.html" rel="prev">
<script src="site_libs/quarto-html/quarto.js"></script>
<script src="site_libs/quarto-html/popper.min.js"></script>
<script src="site_libs/quarto-html/tippy.umd.min.js"></script>
<script src="site_libs/quarto-html/anchor.min.js"></script>
<link href="site_libs/quarto-html/tippy.css" rel="stylesheet">
<link href="site_libs/quarto-html/quarto-syntax-highlighting.css" rel="stylesheet" id="quarto-text-highlighting-styles">
<script src="site_libs/bootstrap/bootstrap.min.js"></script>
<link href="site_libs/bootstrap/bootstrap-icons.css" rel="stylesheet">
<link href="site_libs/bootstrap/bootstrap.min.css" rel="stylesheet" id="quarto-bootstrap" data-mode="light"><script id="quarto-search-options" type="application/json">{
  "location": "sidebar",
  "copy-button": false,
  "collapse-after": 3,
  "panel-placement": "start",
  "type": "textbox",
  "limit": 50,
  "keyboard-shortcut": [
    "f",
    "/",
    "s"
  ],
  "show-item-context": false,
  "language": {
    "search-no-results-text": "No results",
    "search-matching-documents-text": "matching documents",
    "search-copy-link-title": "Copy link to search",
    "search-hide-matches-text": "Hide additional matches",
    "search-more-match-text": "more match in this document",
    "search-more-matches-text": "more matches in this document",
    "search-clear-button-title": "Clear",
    "search-text-placeholder": "",
    "search-detached-cancel-button-title": "Cancel",
    "search-submit-button-title": "Submit",
    "search-label": "搜索"
  }
}</script><script>window.backupDefine = window.define; window.define = undefined;</script><script src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js"></script><script>document.addEventListener("DOMContentLoaded", function () {
 var mathElements = document.getElementsByClassName("math");
 var macros = [];
 for (var i = 0; i < mathElements.length; i++) {
  var texText = mathElements[i].firstChild;
  if (mathElements[i].tagName == "SPAN") {
   katex.render(texText.data, mathElements[i], {
    displayMode: mathElements[i].classList.contains('display'),
    throwOnError: false,
    macros: macros,
    fleqn: false
   });
}}});
  </script><script>window.define = window.backupDefine; window.backupDefine = undefined;</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css">
<script type="text/javascript">
const typesetMath = (el) => {
  if (window.MathJax) {
    // MathJax Typeset
    window.MathJax.typeset([el]);
  } else if (window.katex) {
    // KaTeX Render
    var mathElements = el.getElementsByClassName("math");
    var macros = [];
    for (var i = 0; i < mathElements.length; i++) {
      var texText = mathElements[i].firstChild;
      if (mathElements[i].tagName == "SPAN") {
        window.katex.render(texText.data, mathElements[i], {
          displayMode: mathElements[i].classList.contains('display'),
          throwOnError: false,
          macros: macros,
          fleqn: false
        });
      }
    }
  }
}
window.Quarto = {
  typesetMath
};
</script>
</head>
<body class="nav-sidebar floating">

<div id="quarto-search-results"></div>
  <header id="quarto-header" class="headroom fixed-top"><nav class="quarto-secondary-nav"><div class="container-fluid d-flex">
      <button type="button" class="quarto-btn-toggle btn" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="切换侧边栏导航" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">
        <i class="bi bi-layout-text-sidebar-reverse"></i>
      </button>
        <nav class="quarto-page-breadcrumbs" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./gm-gs.html">叶肉与气孔导度</a></li><li class="breadcrumb-item"><a href="./gs.html"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">气孔导度模型的拟合</span></a></li></ol></nav>
        <a class="flex-grow-1" role="button" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item" aria-controls="quarto-sidebar" aria-expanded="false" aria-label="切换侧边栏导航" onclick="if (window.quartoToggleHeadroom) { window.quartoToggleHeadroom(); }">      
        </a>
      <button type="button" class="btn quarto-search-button" aria-label="" onclick="window.quartoOpenSearch();">
        <i class="bi bi-search"></i>
      </button>
    </div>
  </nav></header><!-- content --><div id="quarto-content" class="quarto-container page-columns page-rows-contents page-layout-article">
<!-- sidebar -->
  <nav id="quarto-sidebar" class="sidebar collapse collapse-horizontal quarto-sidebar-collapse-item sidebar-navigation floating overflow-auto"><div class="pt-lg-2 mt-2 text-left sidebar-header">
    <div class="sidebar-title mb-0 py-0">
      <a href="./">LI-6800 和 LI-6400 光合数据分析指南</a> 
        <div class="sidebar-tools-main">
    <a href="https://github.com/zhujiedong/photosynthesis-analysis/" title="Source Code" class="quarto-navigation-tool px-1" aria-label="Source Code"><i class="bi bi-github"></i></a>
</div>
    </div>
      </div>
        <div class="mt-2 flex-shrink-0 align-items-center">
        <div class="sidebar-search">
        <div id="quarto-search" class="" title="搜索"></div>
        </div>
        </div>
    <div class="sidebar-menu-container"> 
    <ul class="list-unstyled mt-1">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./index.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">欢迎</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./thanks.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">致谢</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./preface.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">序言</span></a>
  </div>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./intro.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">介绍</span></a>
  </div>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./basics.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">必备工具</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-1" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-1" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./rbasics.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">1</span>&nbsp; <span class="chapter-title">R 相关的准备</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./python-basics.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">2</span>&nbsp; <span class="chapter-title">其他工具</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./packages.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">光合相关的软件包</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-2" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-2" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./phtosyn-pacakges.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">3</span>&nbsp; <span class="chapter-title">光合专用软件包</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./general-packages.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">4</span>&nbsp; <span class="chapter-title">生态学通用软件包</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./data-prepare.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">数据准备</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-3" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-3" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./data-import.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">5</span>&nbsp; <span class="chapter-title">数据读取的选项</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./batch-method.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">6</span>&nbsp; <span class="chapter-title">数据的基本处理</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./light-response.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">光响应曲线简介</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-4" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-4" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./nls-start.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">7</span>&nbsp; <span class="chapter-title">非线性拟合初值确定</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./hyp.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">8</span>&nbsp; <span class="chapter-title">直角双曲线模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./non-hypo.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">9</span>&nbsp; <span class="chapter-title">非直角双曲线模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./exp.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">10</span>&nbsp; <span class="chapter-title">指数模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./hyp-rev.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">11</span>&nbsp; <span class="chapter-title">直角双曲线的修正模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./aq-choose.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">12</span>&nbsp; <span class="chapter-title">如何选择合适的模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./big-leaf.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">13</span>&nbsp; <span class="chapter-title">大叶模型</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./python-aq-gui.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">14</span>&nbsp; <span class="chapter-title">介绍</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./aci-curve.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">二氧化碳响应曲线概述</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-5" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-5" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./aci.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">15</span>&nbsp; <span class="chapter-title">Aci 曲线拟合相关</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./DAT-vs-racir.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">16</span>&nbsp; <span class="chapter-title">快速<code>ACi</code> 曲线 (RACiR)</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./plantecowraps.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">17</span>&nbsp; <span class="chapter-title">plantecowrap 温度相关拟合</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./Rd.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">18</span>&nbsp; <span class="chapter-title">Rd 呼吸 相关</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./C4-related.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">19</span>&nbsp; <span class="chapter-title">C4 植物光合模拟</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./fluorescence.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">叶绿素荧光数据的处理</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-6" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-6" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./jiptest.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">20</span>&nbsp; <span class="chapter-title">LI-6800 JIP test 分析</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./other-fluor.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">21</span>&nbsp; <span class="chapter-title">其他叶绿素荧光数据处理</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./gm-gs.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">叶肉与气孔导度</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-7" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-7" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./gs.html" class="sidebar-item-text sidebar-link active">
 <span class="menu-text"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">气孔导度模型的拟合</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./gm.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">23</span>&nbsp; <span class="chapter-title">叶肉导度计算</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a href="./other-stat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text">其他统计方法</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-8" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-8" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./common-stat.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">24</span>&nbsp; <span class="chapter-title">正态分布检验</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./pca.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">25</span>&nbsp; <span class="chapter-title">大话 PCA</span></span></a>
  </div>
</li>
          <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./smatr.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">26</span>&nbsp; <span class="chapter-title">标准主轴分析介绍</span></span></a>
  </div>
</li>
      </ul>
</li>
        <li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./references.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">27</span>&nbsp; <span class="chapter-title">参考文献</span></span></a>
  </div>
</li>
        <li class="sidebar-item sidebar-item-section">
      <div class="sidebar-item-container"> 
            <a class="sidebar-item-text sidebar-link text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="true">
 <span class="menu-text">Appendices</span></a>
          <a class="sidebar-item-toggle text-start" data-bs-toggle="collapse" data-bs-target="#quarto-sidebar-section-9" aria-expanded="true" aria-label="切換部分">
            <i class="bi bi-chevron-right ms-2"></i>
          </a> 
      </div>
      <ul id="quarto-sidebar-section-9" class="collapse list-unstyled sidebar-section depth1 show">
<li class="sidebar-item">
  <div class="sidebar-item-container"> 
  <a href="./a1-run-environment.html" class="sidebar-item-text sidebar-link">
 <span class="menu-text"><span class="chapter-number">A</span>&nbsp; <span class="chapter-title">运行环境</span></span></a>
  </div>
</li>
      </ul>
</li>
    </ul>
</div>
</nav><div id="quarto-sidebar-glass" class="quarto-sidebar-collapse-item" data-bs-toggle="collapse" data-bs-target=".quarto-sidebar-collapse-item"></div>
<!-- margin-sidebar -->
    <div id="quarto-margin-sidebar" class="sidebar margin-sidebar">
        <nav id="TOC" role="doc-toc" class="toc-active"><h2 id="toc-title">Table of contents</h2>
   
  <ul>
<li>
<a href="#sec-plantecophys-stamo" id="toc-sec-plantecophys-stamo" class="nav-link active" data-scroll-target="#sec-plantecophys-stamo"><span class="header-section-number">22.1</span> <code>plantecophys</code> 气孔导度相关函数</a>
  <ul class="collapse">
<li><a href="#sec-fitbb-p" id="toc-sec-fitbb-p" class="nav-link" data-scroll-target="#sec-fitbb-p"><span class="header-section-number">22.1.1</span> <code>fitBB</code> 函数</a></li>
  <li><a href="#sec-fitbbs" id="toc-sec-fitbbs" class="nav-link" data-scroll-target="#sec-fitbbs"><span class="header-section-number">22.1.2</span> <code>fitBBs</code> 函数</a></li>
  </ul>
</li>
  <li>
<a href="#sec-photosynthesi-stamo" id="toc-sec-photosynthesi-stamo" class="nav-link" data-scroll-target="#sec-photosynthesi-stamo"><span class="header-section-number">22.2</span> <code>photosynthesis</code> 气孔导度相关函数</a>
  <ul class="collapse">
<li><a href="#sec-single-photo-stamo" id="toc-sec-single-photo-stamo" class="nav-link" data-scroll-target="#sec-single-photo-stamo"><span class="header-section-number">22.2.1</span> 无分组模型的实现过程</a></li>
  <li><a href="#sec-multi-photo-stoma" id="toc-sec-multi-photo-stoma" class="nav-link" data-scroll-target="#sec-multi-photo-stoma"><span class="header-section-number">22.2.2</span> 分组模型的实现</a></li>
  </ul>
</li>
  <li>
<a href="#stomotal_couple" id="toc-stomotal_couple" class="nav-link" data-scroll-target="#stomotal_couple"><span class="header-section-number">22.3</span> 光合最优气孔导度耦合模型</a>
  <ul class="collapse">
<li><a href="#sec-farao" id="toc-sec-farao" class="nav-link" data-scroll-target="#sec-farao"><span class="header-section-number">22.3.1</span> <code>FARAO</code> 函数</a></li>
  </ul>
</li>
  <li>
<a href="#sec-photo_stomo" id="toc-sec-photo_stomo" class="nav-link" data-scroll-target="#sec-photo_stomo"><span class="header-section-number">22.4</span> 光合气孔导度耦合模型</a>
  <ul class="collapse">
<li><a href="#sec-photosyn" id="toc-sec-photosyn" class="nav-link" data-scroll-target="#sec-photosyn"><span class="header-section-number">22.4.1</span> <code>Photosyn</code> 函数</a></li>
  <li><a href="#photsyneb" id="toc-photsyneb" class="nav-link" data-scroll-target="#photsyneb"><span class="header-section-number">22.4.2</span> <code>PhotosynEB</code> 函数</a></li>
  <li><a href="#sec-photosyntuzet" id="toc-sec-photosyntuzet" class="nav-link" data-scroll-target="#sec-photosyntuzet"><span class="header-section-number">22.4.3</span> <code>PhotosynTuzet</code> 函数</a></li>
  </ul>
</li>
  </ul><div class="toc-actions"><ul><li><a href="https://github.com/zhujiedong/photosynthesis-analysis/edit/master/gs.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li></ul></div></nav>
    </div>
<!-- main -->
<main class="content" id="quarto-document-content"><header id="title-block-header" class="quarto-title-block default"><nav class="quarto-page-breadcrumbs quarto-title-breadcrumbs d-none d-lg-block" aria-label="breadcrumb"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="./gm-gs.html">叶肉与气孔导度</a></li><li class="breadcrumb-item"><a href="./gs.html"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">气孔导度模型的拟合</span></a></li></ol></nav><div class="quarto-title">
<h1 class="title"><span id="sec-stamotal_sim" class="quarto-section-identifier"><span class="chapter-number">22</span>&nbsp; <span class="chapter-title">气孔导度模型的拟合</span></span></h1>
</div>



<div class="quarto-title-meta">

    
  
    
  </div>
  


</header><p>在<del>暂时还没时间</del>多年没时间整理的情况下，先简单记录一下基本操作。</p>
<section id="sec-plantecophys-stamo" class="level2" data-number="22.1"><h2 data-number="22.1" class="anchored" data-anchor-id="sec-plantecophys-stamo">
<span class="header-section-number">22.1</span> <code>plantecophys</code> 气孔导度相关函数</h2>
<section id="sec-fitbb-p" class="level3" data-number="22.1.1"><h3 data-number="22.1.1" class="anchored" data-anchor-id="sec-fitbb-p">
<span class="header-section-number">22.1.1</span> <code>fitBB</code> 函数</h3>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb1"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu">fitBB</span><span class="op">(</span></span>
<span>  <span class="va">data</span>,</span>
<span>  varnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span></span>
<span>    ALEAF <span class="op">=</span> <span class="st">"A"</span>,</span>
<span>    GS <span class="op">=</span> <span class="st">"gsw"</span>,</span>
<span>    VPD <span class="op">=</span> <span class="st">"VPDleaf"</span>,</span>
<span>    Ca <span class="op">=</span> <span class="st">"CO2_s"</span>,</span>
<span>    RH <span class="op">=</span> <span class="st">"RHcham"</span></span>
<span>  <span class="op">)</span>,</span>
<span>  gsmodel <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"BBOpti"</span>, <span class="st">"BBLeuning"</span>, <span class="st">"BallBerry"</span>,</span>
<span>              <span class="st">"BBOptiFull"</span><span class="op">)</span>,</span>
<span>  fitg0 <span class="op">=</span> <span class="cn">FALSE</span></span>
<span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p><strong>参数的意义:</strong></p>
<ul>
<li>data：待分析的数据文件。</li>
<li>varnames：注意，函数默认数据为 6400 格式，因此 6800 的数据文件要按照上文的参数修改。 相对湿度只有在使用 BallBerry 时才需要输入。</li>
<li>gsmodel：上述三个模型之一。</li>
<li>fitg0：默认不计算g0，若需要，改为TRUE。</li>
</ul>
<p><strong>代码示例：</strong></p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb2"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://bitbucket.org/remkoduursma/plantecophys">plantecophys</a></span><span class="op">)</span></span>
<span></span>
<span><span class="va">aci</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/utils/read.table.html">read.csv</a></span><span class="op">(</span><span class="st">"data/aci.csv"</span><span class="op">)</span></span>
<span><span class="va">aci</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/subset.html">subset</a></span><span class="op">(</span><span class="va">aci</span>, <span class="va">Obs</span> <span class="op">&gt;</span> <span class="fl">0</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/fitBB.html">fitBB</a></span><span class="op">(</span></span>
<span>  <span class="va">aci</span>,</span>
<span>  varnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span></span>
<span>    ALEAF <span class="op">=</span> <span class="st">"Photo"</span>,</span>
<span>    GS <span class="op">=</span> <span class="st">"Cond"</span>,</span>
<span>    VPD <span class="op">=</span> <span class="st">"VpdL"</span>,</span>
<span>    Ca <span class="op">=</span> <span class="st">"CO2S"</span>,</span>
<span>    RH <span class="op">=</span> <span class="st">"RH_S"</span></span>
<span>  <span class="op">)</span>,</span>
<span>  gsmodel <span class="op">=</span> <span class="st">"BBOpti"</span>,</span>
<span>  fitg0 <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output cell-output-stdout">
<pre><code>Result of fitBB.
Model :  BBOpti 
Both g0 and g1 were estimated.

Coefficients:
g0  g1
0.326 -0.992 

For more details of the fit, look at summary(myfit$fit)
To return coefficients, do coef(myfit).
(where myfit is the name of the object returned by fitBB)</code></pre>
</div>
</div>
</section><section id="sec-fitbbs" class="level3" data-number="22.1.2"><h3 data-number="22.1.2" class="anchored" data-anchor-id="sec-fitbbs">
<span class="header-section-number">22.1.2</span> <code>fitBBs</code> 函数</h3>
<p>如果我们有多个物种或分组的数据，那么使用 <code>fitBBs</code> 则可以快速拟合多条曲线的数据。我们先整合两次的数据，然后来查看一下运行结果：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb4"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">aci01</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/utils/read.table.html">read.csv</a></span><span class="op">(</span><span class="st">"data/aci01.csv"</span><span class="op">)</span></span>
<span><span class="va">aci01</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/subset.html">subset</a></span><span class="op">(</span><span class="va">aci01</span>, <span class="va">Obs</span> <span class="op">&gt;</span> <span class="fl">0</span><span class="op">)</span></span>
<span><span class="va">multiBB</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/data.frame.html">data.frame</a></span><span class="op">(</span></span>
<span>  A <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">Photo</span>, <span class="va">aci01</span><span class="op">$</span><span class="va">Photo</span><span class="op">)</span>,</span>
<span>  GS <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">Cond</span>, <span class="va">aci01</span><span class="op">$</span><span class="va">Cond</span><span class="op">)</span>,</span>
<span>  CO2S <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">CO2S</span>, <span class="va">aci01</span><span class="op">$</span><span class="va">CO2S</span><span class="op">)</span>,</span>
<span>  VPD <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">VpdL</span>, <span class="va">aci01</span><span class="op">$</span><span class="va">VpdL</span><span class="op">)</span>,</span>
<span>  RH <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">RH_S</span>, <span class="va">aci01</span><span class="op">$</span><span class="va">RH_S</span><span class="op">)</span>,</span>
<span>  species <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="st">"species1"</span>, <span class="fu"><a href="https://rdrr.io/r/base/length.html">length</a></span><span class="op">(</span><span class="va">aci</span><span class="op">$</span><span class="va">Photo</span><span class="op">)</span><span class="op">)</span>,</span>
<span>              <span class="fu"><a href="https://rdrr.io/r/base/rep.html">rep</a></span><span class="op">(</span><span class="st">"species2"</span>, <span class="fu"><a href="https://rdrr.io/r/base/length.html">length</a></span><span class="op">(</span><span class="va">aci01</span><span class="op">$</span><span class="va">Photo</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="op">)</span></span>
<span></span>
<span><span class="va">mod2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/fitBBs.html">fitBBs</a></span><span class="op">(</span></span>
<span>  <span class="va">multiBB</span>,</span>
<span>  group <span class="op">=</span> <span class="st">"species"</span>,</span>
<span>  varnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span></span>
<span>    ALEAF <span class="op">=</span> <span class="st">"A"</span>,</span>
<span>    GS <span class="op">=</span> <span class="st">"GS"</span>,</span>
<span>    VPD <span class="op">=</span> <span class="st">"VPD"</span>,</span>
<span>    Ca <span class="op">=</span> <span class="st">"CO2S"</span>,</span>
<span>    RH <span class="op">=</span> <span class="st">"RH"</span></span>
<span>  <span class="op">)</span>,</span>
<span>  gsmodel <span class="op">=</span> <span class="st">"BallBerry"</span>,</span>
<span>  fitg0 <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>结果为：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb5"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/r/stats/coef.html">coef</a></span><span class="op">(</span><span class="va">mod2</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<div class="cell">
<div class="cell-output-display">
<table class="table table-sm table-striped small">
<thead><tr class="header">
<th style="text-align: left;">group</th>
<th style="text-align: right;">g0</th>
<th style="text-align: right;">g1</th>
</tr></thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">species1</td>
<td style="text-align: right;">0.3263885</td>
<td style="text-align: right;">-0.1734554</td>
</tr>
<tr class="even">
<td style="text-align: left;">species2</td>
<td style="text-align: right;">0.0515873</td>
<td style="text-align: right;">-0.0218842</td>
</tr>
</tbody>
</table>
</div>
</div>
</section></section><section id="sec-photosynthesi-stamo" class="level2" data-number="22.2"><h2 data-number="22.2" class="anchored" data-anchor-id="sec-photosynthesi-stamo">
<span class="header-section-number">22.2</span> <code>photosynthesis</code> 气孔导度相关函数</h2>
<section id="sec-single-photo-stamo" class="level3" data-number="22.2.1"><h3 data-number="22.2.1" class="anchored" data-anchor-id="sec-single-photo-stamo">
<span class="header-section-number">22.2.1</span> 无分组模型的实现过程</h3>
<p>内容与上面 的重复，这里不在运行，仅列出代码。</p>
<p>读取数据：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb6"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://github.com/cdmuir/photosynthesis">photosynthesis</a></span><span class="op">)</span></span>
<span><span class="va">df</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/utils/read.table.html">read.csv</a></span><span class="op">(</span><span class="st">"data/A_Ci_Q_data_1.csv"</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>BallBerry 模型需要相对湿度，而 LI-6800 的相对湿度数据实际上是转换为百分数后的数据，因此需要处理一下，然后这个函数的方便之处是，它可以一次拟合出所有的模型来：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb7"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">df</span><span class="op">$</span><span class="va">RH</span> <span class="op">&lt;-</span> <span class="va">df</span><span class="op">$</span><span class="va">RHcham</span> <span class="op">/</span> <span class="fl">100</span></span>
<span></span>
<span><span class="va">fits</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/photosynthesis/man/fit_gs_model.html">fit_gs_model</a></span><span class="op">(</span></span>
<span>  data <span class="op">=</span> <span class="va">df</span>,</span>
<span>  varnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span></span>
<span>    A_net <span class="op">=</span> <span class="st">"A"</span>,</span>
<span>    C_air <span class="op">=</span> <span class="st">"Ca"</span>,</span>
<span>    g_sw <span class="op">=</span> <span class="st">"gsw"</span>,</span>
<span>    RH <span class="op">=</span> <span class="st">"RH"</span>,</span>
<span>    VPD <span class="op">=</span> <span class="st">"VPDleaf"</span></span>
<span>  <span class="op">)</span>,</span>
<span>  model <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"BallBerry"</span>,</span>
<span>            <span class="st">"Leuning"</span>,</span>
<span>            <span class="st">"Medlyn_partial"</span>,</span>
<span>            <span class="st">"Medlyn_full"</span><span class="op">)</span>,</span>
<span>  D0 <span class="op">=</span> <span class="fl">3</span></span>
<span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>函数的参数其实都比较简单，如果对非线性拟合不满意，也可以传入 <code>nlsLM</code> 的参数。</p>
<section id="sec-photo-stoma-result" class="level4"><h4 class="anchored" data-anchor-id="sec-photo-stoma-result">结果的查看</h4>
<p><code>fit_gs_model</code> 结果有两个水平，第一层 list 是拟合模型，第二层则是模型相关的参数、图形等，可以通过位置查看：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb8"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">fits</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">[</span><span class="fl">1</span><span class="op">]</span></span>
<span><span class="va">fits</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">[</span><span class="fl">2</span><span class="op">]</span></span>
<span><span class="va">fits</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span><span class="op">[</span><span class="fl">3</span><span class="op">]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>也可以通过名称查看：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb9"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">fits</span><span class="op">$</span><span class="va">BallBerry</span><span class="op">$</span><span class="va">Parameters</span></span>
<span><span class="va">fits</span><span class="op">$</span><span class="va">Leuning</span><span class="op">$</span><span class="va">Graph</span></span>
<span><span class="va">fits</span><span class="op">$</span><span class="va">Medlyn_partial</span><span class="op">$</span><span class="va">Parameters</span></span>
<span><span class="va">fits</span><span class="op">$</span><span class="va">Medlyn_full</span><span class="op">$</span><span class="va">Parameters</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section></section><section id="sec-multi-photo-stoma" class="level3" data-number="22.2.2"><h3 data-number="22.2.2" class="anchored" data-anchor-id="sec-multi-photo-stoma">
<span class="header-section-number">22.2.2</span> 分组模型的实现</h3>
<p>分组数据处理起来也比较方便，例如下面以光强为分组，<code>photosynthesis</code> 提供了两个方便的函数，帮助进行分组数据的操作，<code>fit_many</code> 用于选择函数用于分组数据，<code>compile_data</code> 用于将 <code>list</code> 结果转为 <code>dataframe</code>：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb10"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">df</span><span class="op">$</span><span class="va">Q_2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/factor.html">as.factor</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/Round.html">round</a></span><span class="op">(</span><span class="va">df</span><span class="op">$</span><span class="va">Qin</span>, digits <span class="op">=</span> <span class="fl">0</span><span class="op">)</span><span class="op">)</span></span>
<span></span>
<span><span class="va">fits</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/photosynthesis/man/fit_many.html">fit_many</a></span><span class="op">(</span></span>
<span>  <span class="va">df</span>,</span>
<span>  varnames <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/list.html">list</a></span><span class="op">(</span></span>
<span>    A_net <span class="op">=</span> <span class="st">"A"</span>,</span>
<span>    C_air <span class="op">=</span> <span class="st">"Ca"</span>,</span>
<span>    g_sw <span class="op">=</span> <span class="st">"gsw"</span>,</span>
<span>    RH <span class="op">=</span> <span class="st">"RH"</span>,</span>
<span>    VPD <span class="op">=</span> <span class="st">"VPDleaf"</span></span>
<span>  <span class="op">)</span>,</span>
<span>  funct <span class="op">=</span> <span class="va">fit_gs_model</span>,</span>
<span>  group <span class="op">=</span> <span class="st">"Q_2"</span></span>
<span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>数据的查看比之前又多了一个水平，例如 750 光强下的数据：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb11"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">fits</span><span class="op">[[</span><span class="st">"750"</span><span class="op">]</span><span class="op">]</span><span class="op">[[</span><span class="st">"Medlyn_partial"</span><span class="op">]</span><span class="op">]</span><span class="op">[[</span><span class="st">"Parameters"</span><span class="op">]</span><span class="op">]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>这里转换过程分两部，首先是将所有的参数转为 <code>list</code> 形式，转换对象是 1，也就是第一个模型 BallBerry。然后再将这个 <code>list</code> 进行一次转换，不同分组的参数 <code>Parameters</code>（顺序可参考未分组数据的结果）：</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb12"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">bbmods</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/photosynthesis/man/compile_data.html">compile_data</a></span><span class="op">(</span>data <span class="op">=</span> <span class="va">fits</span>,</span>
<span>                     output_type <span class="op">=</span> <span class="st">"list"</span>,</span>
<span>                     list_element <span class="op">=</span> <span class="fl">1</span><span class="op">)</span></span>
<span><span class="va">bbpars</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/photosynthesis/man/compile_data.html">compile_data</a></span><span class="op">(</span>data <span class="op">=</span> <span class="va">bbmods</span>,</span>
<span>                     output_type <span class="op">=</span> <span class="st">"dataframe"</span>,</span>
<span>                     list_element <span class="op">=</span> <span class="fl">2</span><span class="op">)</span></span>
<span></span>
<span><span class="va">bbpars</span><span class="op">$</span><span class="va">ID</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/numeric.html">as.numeric</a></span><span class="op">(</span><span class="va">bbpars</span><span class="op">$</span><span class="va">ID</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">g0</span> <span class="op">~</span> <span class="va">ID</span>, <span class="va">bbpars</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>最后展示的图形是不同光强下，拟合的截距的差异。多个图形也可以使用这种方式转换，不过存储的类型最好是 <code>list</code>（存储的是 <code>ggplot2</code> 对象的类）。例如 <code>vignette</code> 使用下面的方式查看第三幅图的结果。</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb13"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="va">graphs</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/photosynthesis/man/compile_data.html">compile_data</a></span><span class="op">(</span>data <span class="op">=</span> <span class="va">bbmods</span>,</span>
<span>                       output_type <span class="op">=</span> <span class="st">"list"</span>,</span>
<span>                       list_element <span class="op">=</span> <span class="fl">3</span><span class="op">)</span></span>
<span></span>
<span><span class="va">graphs</span><span class="op">[[</span><span class="fl">3</span><span class="op">]</span><span class="op">]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
</section></section><section id="stomotal_couple" class="level2" data-number="22.3"><h2 data-number="22.3" class="anchored" data-anchor-id="stomotal_couple">
<span class="header-section-number">22.3</span> 光合最优气孔导度耦合模型</h2>
<p><span class="citation" data-cites="Cowan1977Stomatal">Cowan 和 Farquhar (<a href="references.html#ref-Cowan1977Stomatal" role="doc-biblioref">1977</a>)</span> 关于最优气孔导度的描述概括如下： 最优气孔行为理论认为气孔的最优化行为，指的是在某一时间段内， 最大化的进行光合碳固定的同时最小化的进行蒸腾作用，也就是说，对于一定的水分消耗，得到最大化的光合碳固定。即使得：</p>
<p><span id="eq-weff"><span class="math display">
A - \lambda E
\tag{22.1}</span></span></p>
<p>最大化，其中 <span class="math inline">\lambda</span> 是临界水分利用效率，也即植物损耗单位水分的 C 生产量，单位一般为 <span class="math inline">mol \: CO_2 \cdot mol^{-1} H_2O</span>，可通过光合速率和蒸腾速率的比值计算。<code>plantecophys</code> 包含了相关的函数来处理。</p>
<section id="sec-farao" class="level3" data-number="22.3.1"><h3 data-number="22.3.1" class="anchored" data-anchor-id="sec-farao">
<span class="header-section-number">22.3.1</span> <code>FARAO</code> 函数</h3>
<p><code>FARAO</code> 函数用于找到最大化 <span class="math inline">A - \lambda E</span> 解的** Ci **值，这里是利用数值解的形式求解方程。</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb14"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/FARAO.html">FARAO</a></span><span class="op">(</span>lambda <span class="op">=</span> <span class="fl">0.002</span>, Ca <span class="op">=</span> <span class="fl">400</span>, VPD <span class="op">=</span> <span class="fl">1</span>,</span>
<span>      photo <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"BOTH"</span>, <span class="st">"VCMAX"</span>,<span class="st">"JMAX"</span><span class="op">)</span>, </span>
<span>      energybalance <span class="op">=</span> <span class="cn">FALSE</span>, C4 <span class="op">=</span> <span class="cn">FALSE</span>, </span>
<span>      Tair <span class="op">=</span> <span class="fl">25</span>, Wind <span class="op">=</span> <span class="fl">2</span>, Wleaf <span class="op">=</span> <span class="fl">0.02</span>,</span>
<span>      StomatalRatio <span class="op">=</span> <span class="fl">1</span>, LeafAbs <span class="op">=</span> <span class="fl">0.86</span>, <span class="va">...</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/FARAO.html">FARAO2</a></span><span class="op">(</span>lambda <span class="op">=</span> <span class="fl">0.002</span>, Ca <span class="op">=</span> <span class="fl">400</span>, </span>
<span>       energybalance <span class="op">=</span> <span class="cn">FALSE</span>, <span class="va">...</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>其参数同 <code>fitaci</code> 和 <code>Photosyn</code>，在此不多做介绍，<code>FARAO</code> 使用的是 <span class="citation" data-cites="Cowan1977Stomatal">Cowan 和 Farquhar (<a href="references.html#ref-Cowan1977Stomatal" role="doc-biblioref">1977</a>)</span> 的方法得到最优化的 Ci 值, <code>FARAO2</code> 则更简单或可能更稳定，利用 <span class="citation" data-cites="Buckley2014Is">Buckley 等 (<a href="references.html#ref-Buckley2014Is" role="doc-biblioref">2014</a>)</span> 的方法来计算, <span class="citation" data-cites="Medlyn2011Reconciling">Medlyn 等 (<a href="references.html#ref-Medlyn2011Reconciling" role="doc-biblioref">2011</a>)</span> 的方法是这个数值解的近似值。</p>
</section></section><section id="sec-photo_stomo" class="level2" data-number="22.4"><h2 data-number="22.4" class="anchored" data-anchor-id="sec-photo_stomo">
<span class="header-section-number">22.4</span> 光合气孔导度耦合模型</h2>
<p><span class="citation" data-cites="Duursma2015Plantecophys">Remko A. Duursma (<a href="references.html#ref-Duursma2015Plantecophys" role="doc-biblioref">2015</a>)</span> 对于气体交换耦合模型的简述如下：</p>
<ul>
<li>对于 FvCB 模型有：</li>
</ul>
<p><span id="eq-minfvcb"><span class="math display">
A_n = min(A_c, A_j)-R_d
\tag{22.2}</span></span></p>
<ul>
<li>在假定 gm 为恒定的前提下：</li>
</ul>
<p><span id="eq-cgm"><span class="math display">
C_c = C_i - \frac{A_n}{g_m}
\tag{22.3}</span></span></p>
<ul>
<li>根据 Ficker 定理</li>
</ul>
<p><span id="eq-ficker"><span class="math display">
A_n = \frac{g_s}{1.6}(C_a - C_i)
\tag{22.4}</span></span></p>
<p>以及 BallBerry 气孔导度模型 <span id="eq-driver"><span class="math display">
g_s = g_0 + g_1 \frac{A_n}{C_a} f(D)
\tag{22.5}</span></span></p>
<p>整合公式 <a href="#eq-minfvcb" class="quarto-xref">公式 &nbsp;<span>22.2</span></a>, <a href="#eq-cgm" class="quarto-xref">公式 &nbsp;<span>22.3</span></a>, <a href="#eq-ficker" class="quarto-xref">公式 &nbsp;<span>22.4</span></a> 和 <a href="#eq-driver" class="quarto-xref">公式 &nbsp;<span>22.5</span></a> 后得到气体交换的耦合模型，气体交换耦合模型有很多更大尺度上的应用，例如 <span class="citation" data-cites="Duursma2012MAESPA">R. A. Duursma 和 Medlyn (<a href="references.html#ref-Duursma2012MAESPA" role="doc-biblioref">2012</a>)</span> 和 wang1998a，可用于预测 An，gs 和蒸腾速率对主要环境驱动因子的响应（除土壤水分），并包含了主要的叶片性状（g1，V<sub>cmax</sub>, J<sub>max</sub>, R<sub>d</sub> 以及他们的温度依赖性）。</p>
<section id="sec-photosyn" class="level3" data-number="22.4.1"><h3 data-number="22.4.1" class="anchored" data-anchor-id="sec-photosyn">
<span class="header-section-number">22.4.1</span> <code>Photosyn</code> 函数</h3>
<p>Photosyn 为耦合的光合–气孔导度模型，基于 Farquhar 光合模型和 Ball-Berry 气孔导度模型。</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb15"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Photosyn</a></span><span class="op">(</span>VPD <span class="op">=</span> <span class="fl">1.5</span>, Ca <span class="op">=</span> <span class="fl">400</span>, PPFD <span class="op">=</span> <span class="fl">1500</span>,</span>
<span>         Tleaf <span class="op">=</span> <span class="fl">25</span>, Patm <span class="op">=</span> <span class="fl">100</span>,RH <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>         gsmodel <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"BBOpti"</span>, <span class="st">"BBLeuning"</span>, </span>
<span>                     <span class="st">"BallBerry"</span>, <span class="st">"BBdefine"</span><span class="op">)</span>,</span>
<span>         g1 <span class="op">=</span> <span class="fl">4</span>, g0 <span class="op">=</span> <span class="fl">0</span>, gk <span class="op">=</span> <span class="fl">0.5</span>, vpdmin <span class="op">=</span> <span class="fl">0.5</span>,</span>
<span>         D0 <span class="op">=</span> <span class="fl">5</span>, GS <span class="op">=</span> <span class="cn">NULL</span>, BBmult <span class="op">=</span> <span class="cn">NULL</span>, </span>
<span>         alpha <span class="op">=</span> <span class="fl">0.24</span>, theta <span class="op">=</span> <span class="fl">0.85</span>, Jmax <span class="op">=</span> <span class="fl">100</span>,</span>
<span>         Vcmax <span class="op">=</span> <span class="fl">50</span>, gmeso <span class="op">=</span> <span class="cn">NULL</span>, TPU <span class="op">=</span> <span class="fl">1000</span>, </span>
<span>         alphag <span class="op">=</span> <span class="fl">0</span>, Rd0 <span class="op">=</span> <span class="fl">0.92</span>, Q10 <span class="op">=</span> <span class="fl">1.92</span>,</span>
<span>         Rd <span class="op">=</span> <span class="cn">NULL</span>, TrefR <span class="op">=</span> <span class="fl">25</span>, Rdayfrac <span class="op">=</span> <span class="fl">1</span>, </span>
<span>         EaV <span class="op">=</span> <span class="fl">82620.87</span>, EdVC <span class="op">=</span> <span class="fl">0</span>, delsC <span class="op">=</span> <span class="fl">645.1013</span>, </span>
<span>         EaJ <span class="op">=</span> <span class="fl">39676.89</span>, EdVJ <span class="op">=</span> <span class="fl">2e+05</span>, delsJ <span class="op">=</span> <span class="fl">641.3615</span>,</span>
<span>         GammaStar <span class="op">=</span> <span class="cn">NULL</span>, Km <span class="op">=</span> <span class="cn">NULL</span>, Ci <span class="op">=</span> <span class="cn">NULL</span>, </span>
<span>         Tcorrect <span class="op">=</span> <span class="cn">TRUE</span>,returnParsOnly <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>         whichA <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"Ah"</span>, <span class="st">"Amin"</span>, <span class="st">"Ac"</span>, <span class="st">"Aj"</span><span class="op">)</span><span class="op">)</span></span>
<span></span>
<span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Aci</a></span><span class="op">(</span><span class="va">Ci</span>, <span class="va">...</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<p>因为是光合气孔导度模型的耦合，故而参数与之前的函数相同，参见 <a href="#sec-fitbb-p" class="quarto-xref"><span>sec. 22.1.1</span></a> 和 <a href="aci.html" class="quarto-xref"><span>章节 15</span></a> 部分的内容。</p>
<section id="sec-photo_exam" class="level4"><h4 class="anchored" data-anchor-id="sec-photo_exam">
<code>Photosyn</code> 使用举例</h4>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb16"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html">library</a></span><span class="op">(</span><span class="va"><a href="https://bitbucket.org/remkoduursma/plantecophys">plantecophys</a></span><span class="op">)</span></span>
<span><span class="co"># 仅使用下面几个参数运行模型</span></span>
<span><span class="co">#（其他参数使用默认值）</span></span>
<span><span class="co"># 利用已测量或计算的参数</span></span>
<span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Photosyn</a></span><span class="op">(</span>VPD<span class="op">=</span><span class="fl">2</span>, g1<span class="op">=</span><span class="fl">4</span>, Ca<span class="op">=</span><span class="fl">500</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output cell-output-stdout">
<pre><code>        Ci    ALEAF        GS    ELEAF       Ac       Aj   Ap   Rd VPD Tleaf
1 369.3981 14.19466 0.1706377 3.412753 15.12654 17.03685 1000 0.92   2    25
   Ca       Cc PPFD Patm
1 500 369.3981 1500  100</code></pre>
</div>
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb18"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># 部分参数相同，而某一参数或某几个参数不同时，</span></span>
<span><span class="co"># 可以将不同的参数设置为一个序列（vectors）</span></span>
<span><span class="va">r</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Photosyn</a></span><span class="op">(</span>VPD<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html">seq</a></span><span class="op">(</span><span class="fl">0.5</span>, <span class="fl">4</span>, length<span class="op">=</span><span class="fl">25</span><span class="op">)</span>, </span>
<span>              Vcmax<span class="op">=</span><span class="fl">50</span>, Jmax<span class="op">=</span><span class="fl">100</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">r</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">VPD</span>, <span class="va">ALEAF</span>, type<span class="op">=</span><span class="st">'l'</span><span class="op">)</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output-display">
<div id="fig-vpd" class="quarto-figure quarto-figure-center quarto-float anchored">
<figure class="quarto-float quarto-float-fig figure"><div aria-describedby="fig-vpd-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="gs_files/figure-html/fig-vpd-1.png" class="img-fluid figure-img" width="672">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-vpd-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;22.1: VPD VS. An
</figcaption></figure>
</div>
</div>
</div>
<p><a href="#fig-vpd" class="quarto-xref">Figure&nbsp;<span>22.1</span></a> 显示了不同 VPD 下的光合速率。</p>
<div class="cell" data-abel="fig-ppfd">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb19"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># 设定叶肉导度的拟合</span></span>
<span><span class="va">run1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Photosyn</a></span><span class="op">(</span>PPFD<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html">seq</a></span><span class="op">(</span><span class="fl">50</span>,<span class="fl">1000</span>,length<span class="op">=</span><span class="fl">25</span><span class="op">)</span>, </span>
<span>                 gmeso<span class="op">=</span><span class="fl">0.15</span>, Vcmax<span class="op">=</span><span class="fl">40</span>, Jmax<span class="op">=</span><span class="fl">85</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">run1</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">PPFD</span>, <span class="va">GS</span>, type<span class="op">=</span><span class="st">'l'</span><span class="op">)</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure"><p><img src="gs_files/figure-html/unnamed-chunk-17-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>PPFD VS. GS</figcaption></figure>
</div>
</div>
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb20"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># 运行ACi曲线数据（提供Ci值而不是计算）</span></span>
<span><span class="va">arun1</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Aci</a></span><span class="op">(</span>Ci<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html">seq</a></span><span class="op">(</span><span class="fl">50</span>, <span class="fl">1200</span>, length<span class="op">=</span><span class="fl">101</span><span class="op">)</span>, </span>
<span>             Vcmax<span class="op">=</span><span class="fl">40</span>, Jmax<span class="op">=</span><span class="fl">85</span><span class="op">)</span></span>
<span><span class="va">arun2</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Aci</a></span><span class="op">(</span>Ci<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html">seq</a></span><span class="op">(</span><span class="fl">50</span>, <span class="fl">1200</span>, length<span class="op">=</span><span class="fl">101</span><span class="op">)</span>, </span>
<span>             Vcmax<span class="op">=</span><span class="fl">30</span>, Jmax<span class="op">=</span><span class="fl">70</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">arun1</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">Ci</span>, <span class="va">ALEAF</span>, type<span class="op">=</span><span class="st">'l'</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">arun2</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/points.html">points</a></span><span class="op">(</span><span class="va">Ci</span>, <span class="va">ALEAF</span>, type<span class="op">=</span><span class="st">'l'</span>, lty<span class="op">=</span><span class="fl">5</span><span class="op">)</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure"><p><img src="gs_files/figure-html/unnamed-chunk-17-2.png" class="img-fluid figure-img" width="672"></p>
<figcaption>PPFD VS. GS</figcaption></figure>
</div>
</div>
</div>
<p><span class="quarto-unresolved-ref">?fig-ppfd</span> 显示不同 C<sub>i</sub> 下的光合速率。</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb21"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="co"># 找出CO2需求和供给的交叉点</span></span>
<span><span class="co"># 设定部分参数</span></span>
<span><span class="va">gs</span> <span class="op">&lt;-</span> <span class="fl">0.2</span> <span class="co"># 对水的气孔导度</span></span>
<span><span class="va">Ca</span> <span class="op">&lt;-</span> <span class="fl">400</span> <span class="co"># 外部CO2</span></span>
<span><span class="va">gctogw</span> <span class="op">&lt;-</span> <span class="fl">1.57</span> <span class="co"># 转换系数</span></span>
<span><span class="va">gc</span> <span class="op">&lt;-</span> <span class="va">gs</span> <span class="op">/</span> <span class="va">gctogw</span> <span class="co"># 对 CO2 的气孔导度</span></span>
<span><span class="co"># 需求曲线</span></span>
<span><span class="va">p</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Aci</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/seq.html">seq</a></span><span class="op">(</span><span class="fl">60</span>,<span class="fl">500</span>,length<span class="op">=</span><span class="fl">101</span><span class="op">)</span>, Ca<span class="op">=</span><span class="fl">400</span><span class="op">)</span></span>
<span><span class="co"># 提供气孔导度及交叉点</span></span>
<span><span class="va">g</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/Photosyn.html">Photosyn</a></span><span class="op">(</span>GS<span class="op">=</span><span class="va">gs</span>, Ca<span class="op">=</span><span class="va">Ca</span><span class="op">)</span></span>
<span><span class="co"># 交叉点可视化</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html">par</a></span><span class="op">(</span>yaxs<span class="op">=</span><span class="st">"i"</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">p</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html">plot</a></span><span class="op">(</span><span class="va">Ci</span>, <span class="va">ALEAF</span>, type<span class="op">=</span><span class="st">'l'</span>, </span>
<span>             ylim<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">0</span>,<span class="fu"><a href="https://rdrr.io/r/base/Extremes.html">max</a></span><span class="op">(</span><span class="va">ALEAF</span><span class="op">)</span><span class="op">)</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/with.html">with</a></span><span class="op">(</span><span class="va">g</span>, <span class="fu"><a href="https://rdrr.io/r/graphics/points.html">points</a></span><span class="op">(</span><span class="va">Ci</span>, <span class="va">ALEAF</span>, pch<span class="op">=</span><span class="fl">19</span>, col<span class="op">=</span><span class="st">"red"</span><span class="op">)</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/graphics/abline.html">abline</a></span><span class="op">(</span><span class="va">gc</span> <span class="op">*</span> <span class="va">Ca</span>, <span class="op">-</span><span class="va">gc</span>, lty<span class="op">=</span><span class="fl">5</span><span class="op">)</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/graphics/legend.html">legend</a></span><span class="op">(</span><span class="st">"topleft"</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/expression.html">expression</a></span><span class="op">(</span></span>
<span>  <span class="st">"Demand:"</span><span class="op">~</span><span class="op">~</span><span class="va">A</span><span class="op">==</span><span class="fu">f</span><span class="op">(</span><span class="va">C</span><span class="op">[</span><span class="va">i</span><span class="op">]</span><span class="op">)</span><span class="op">)</span>,</span>
<span>   <span class="fu"><a href="https://rdrr.io/r/base/expression.html">expression</a></span><span class="op">(</span><span class="st">"Supply:"</span><span class="op">~</span><span class="op">~</span><span class="va">A</span><span class="op">==</span><span class="va">g</span><span class="op">[</span><span class="va">c</span><span class="op">]</span><span class="op">*</span><span class="op">(</span><span class="va">C</span><span class="op">[</span><span class="va">a</span><span class="op">]</span><span class="op">-</span><span class="va">C</span><span class="op">[</span><span class="va">i</span><span class="op">]</span><span class="op">)</span><span class="op">)</span>,</span>
<span>              <span class="st">"Operating point"</span><span class="op">)</span>,</span>
<span>   lty<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="fl">1</span>,<span class="fl">5</span>,<span class="op">-</span><span class="fl">1</span><span class="op">)</span>,pch<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="op">-</span><span class="fl">1</span>,<span class="op">-</span><span class="fl">1</span>,<span class="fl">19</span><span class="op">)</span>,</span>
<span>   col<span class="op">=</span><span class="fu"><a href="https://rdrr.io/r/base/c.html">c</a></span><span class="op">(</span><span class="st">"black"</span>,<span class="st">"black"</span>,<span class="st">"red"</span><span class="op">)</span>,</span>
<span>   bty<span class="op">=</span><span class="st">'n'</span>, cex<span class="op">=</span><span class="fl">0.9</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details><div class="cell-output-display">
<div id="fig-supply" class="quarto-figure quarto-figure-center quarto-float anchored">
<figure class="quarto-float quarto-float-fig figure"><div aria-describedby="fig-supply-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="gs_files/figure-html/fig-supply-1.png" class="img-fluid figure-img" width="672">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-supply-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;22.2: supply VS. demand
</figcaption></figure>
</div>
</div>
</div>
<p><a href="#fig-supply" class="quarto-xref">Figure&nbsp;<span>22.2</span></a> 需求与供给的关系。</p>
</section></section><section id="photsyneb" class="level3" data-number="22.4.2"><h3 data-number="22.4.2" class="anchored" data-anchor-id="photsyneb">
<span class="header-section-number">22.4.2</span> <code>PhotosynEB</code> 函数</h3>
<p>使用同 <code>Photosyn</code>，只不过使用能量平衡法来计算叶温。</p>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
警告
</div>
</div>
<div class="callout-body-container callout-body">
<p>目前版本尚存在bug，不能直接提供 GS 来计算，否则会出现未知错误。</p>
</div>
</div>
</section><section id="sec-photosyntuzet" class="level3" data-number="22.4.3"><h3 data-number="22.4.3" class="anchored" data-anchor-id="sec-photosyntuzet">
<span class="header-section-number">22.4.3</span> <code>PhotosynTuzet</code> 函数</h3>
<p>同样为光合气孔导度耦合模型，只不过基于 <span class="citation" data-cites="tuzet2003a">Tuzet, Perrier, 和 Leuning (<a href="references.html#ref-tuzet2003a" role="doc-biblioref">2003</a>)</span> 的气孔导度模型，现将其描述如下：</p>
<p><span id="eq-tuzet"><span class="math display">
g_{co2} = g_0 + \frac{a A}{C_i - \Gamma} f_{\Psi v}
\tag{22.6}</span></span></p>
<p>其中 g<sub>co2</sub> 为对 CO<sub>2</sub> 的气孔导度， g<sub>0</sub> 是残余导度（residual conductance）(在补偿点时限制 g<sub>CO2</sub> 的值）， A 为光合速率，C<sub>i</sub> 为胞间二氧化碳浓度，<span class="math inline">\Gamma</span> 为 CO<sub>2</sub> 补偿点，a 是经验系数。</p>
<p>一个根据经验的逻辑方程用于描述气孔对水势的敏感性：</p>
<p><span id="eq-ftuzet"><span class="math display">
f_{\Psi v} = \frac{1 + exp(s_f \Psi_f)}{1 + exp(s_f(\Psi_f - \Psi_v))}
\tag{22.7}</span></span></p>
<p><span class="math inline">\Psi_v</span> 是指叶片水势，<span class="math inline">\Psi_f</span> 是参比势能， 该方程假设在水势接近于 0 时，气孔对叶片水势不敏感，并且气孔随着 <span class="math inline">\Psi_v</span> 的下降快速关闭。<span class="math inline">\Psi_f</span> 和 <span class="math inline">s_f</span> (曲线形状参数) 依赖于不同物种的形态学适应以及生长过程中所处的环境。</p>
<section id="sec-photosyntuzet_para" class="level4"><h4 class="anchored" data-anchor-id="sec-photosyntuzet_para">
<code>PhotosynTuzet</code> 的参数</h4>
<p>除 <span class="citation" data-cites="tuzet2003a">Tuzet, Perrier, 和 Leuning (<a href="references.html#ref-tuzet2003a" role="doc-biblioref">2003</a>)</span> 模型中使用的参数外，其他参数都继承了 <code>Photosyn</code> 的参数</p>
<div class="cell">
<details open="" class="code-fold"><summary>Code</summary><div class="sourceCode" id="cb22"><pre class="downlit sourceCode r code-with-copy"><code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/plantecophys/man/PhotosynTuzet.html">PhotosynTuzet</a></span><span class="op">(</span>g1 <span class="op">=</span> <span class="fl">8</span>, Ca <span class="op">=</span> <span class="fl">400</span>, psis <span class="op">=</span> <span class="fl">0</span>,</span>
<span>              kl <span class="op">=</span> <span class="fl">2</span>, sf <span class="op">=</span> <span class="fl">3</span>, psif <span class="op">=</span> <span class="op">-</span><span class="fl">2</span>,</span>
<span><span class="va">...</span><span class="op">)</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</details>
</div>
<ul>
<li>g1：斜率参数，要远比 <code>fitBB</code> 中的大。</li>
<li>Ca：外界大气 CO<sub>2</sub> 浓度</li>
<li>psis，土壤水势（Mpa）。</li>
<li>kl：Leaf-speciﬁc hydraulic conductance（叶片导水参数 (<span class="math inline">mmol \cdot m^{-2} \cdot s^{-1} \cdot MPa^{-1}</span>)，叶片蒸腾量、叶片面积及叶片水势计算）。</li>
<li>sf：曲线形状参数。</li>
<li>在气孔导度为最大值 50% 时的叶片水势。</li>
</ul>


<div id="refs" class="references csl-bib-body hanging-indent" data-entry-spacing="0" role="list" style="display: none">
<div id="ref-Buckley2014Is" class="csl-entry" role="listitem">
Buckley, T. N., S Martorell, A Diazespejo, M Tomàs, 和 H Medrano. 2014. <span>《Is stomatal conductance optimized over both time and space in plant crowns? A field test in grapevine Vitis vinifera.》</span> <em>Plant Cell &amp; Environment</em> 37 (12): 2707.
</div>
<div id="ref-Cowan1977Stomatal" class="csl-entry" role="listitem">
Cowan, I. R., 和 G. D. Farquhar. 1977. <span>《Stomatal function in relation to leaf metabolism and environment.》</span> <em>Symposia of the Society for Experimental Biology</em> 31 (23): 471.
</div>
<div id="ref-Duursma2012MAESPA" class="csl-entry" role="listitem">
Duursma, R. A., 和 B. E. Medlyn. 2012. <span>《MAESPA: a model to study interactions between water limitation, environmental drivers and vegetation function at tree and stand levels, with an example application to CO<span class="math inline">_2</span> drought interactions》</span>. <em>Geoscientific Model Development Discussions</em> 5 (4): 919–40.
</div>
<div id="ref-Duursma2015Plantecophys" class="csl-entry" role="listitem">
Duursma, Remko A. 2015. <span>《Plantecophys-An R Package for Analysing and Modelling Leaf Gas Exchange Data》</span>. <em>Plos One</em> 10 (11): e0143346.
</div>
<div id="ref-Medlyn2011Reconciling" class="csl-entry" role="listitem">
Medlyn, Belinda E., Remko A. Duursma, Derek Eamus, David S. Ellsworth, I. Colin Prentice, Craig V. M. Barton, Kristine Y. Crous, Paolo De Angelis, Michael Freeman, 和 Lisa Wingate. 2011. <span>《Reconciling the optimal and empirical approaches to modelling stomatal conductance》</span>. <em>Global Change Biology</em> 17 (6): 2134–44.
</div>
<div id="ref-tuzet2003a" class="csl-entry" role="listitem">
Tuzet, A, A Perrier, 和 R Leuning. 2003. <span>《A coupled model of stomatal conductance, photosynthesis and transpiration》</span>. <em>Plant Cell and Environment</em> 26 (7): 1097–1116.
</div>
</div>
</section></section></section></main><!-- /main --><script id="quarto-html-after-body" type="application/javascript">
window.document.addEventListener("DOMContentLoaded", function (event) {
  const toggleBodyColorMode = (bsSheetEl) => {
    const mode = bsSheetEl.getAttribute("data-mode");
    const bodyEl = window.document.querySelector("body");
    if (mode === "dark") {
      bodyEl.classList.add("quarto-dark");
      bodyEl.classList.remove("quarto-light");
    } else {
      bodyEl.classList.add("quarto-light");
      bodyEl.classList.remove("quarto-dark");
    }
  }
  const toggleBodyColorPrimary = () => {
    const bsSheetEl = window.document.querySelector("link#quarto-bootstrap");
    if (bsSheetEl) {
      toggleBodyColorMode(bsSheetEl);
    }
  }
  toggleBodyColorPrimary();  
  const icon = "";
  const anchorJS = new window.AnchorJS();
  anchorJS.options = {
    placement: 'right',
    icon: icon
  };
  anchorJS.add('.anchored');
  const isCodeAnnotation = (el) => {
    for (const clz of el.classList) {
      if (clz.startsWith('code-annotation-')) {                     
        return true;
      }
    }
    return false;
  }
  const clipboard = new window.ClipboardJS('.code-copy-button', {
    text: function(trigger) {
      const codeEl = trigger.previousElementSibling.cloneNode(true);
      for (const childEl of codeEl.children) {
        if (isCodeAnnotation(childEl)) {
          childEl.remove();
        }
      }
      return codeEl.innerText;
    }
  });
  clipboard.on('success', function(e) {
    // button target
    const button = e.trigger;
    // don't keep focus
    button.blur();
    // flash "checked"
    button.classList.add('code-copy-button-checked');
    var currentTitle = button.getAttribute("title");
    button.setAttribute("title", "已复制");
    let tooltip;
    if (window.bootstrap) {
      button.setAttribute("data-bs-toggle", "tooltip");
      button.setAttribute("data-bs-placement", "left");
      button.setAttribute("data-bs-title", "已复制");
      tooltip = new bootstrap.Tooltip(button, 
        { trigger: "manual", 
          customClass: "code-copy-button-tooltip",
          offset: [0, -8]});
      tooltip.show();    
    }
    setTimeout(function() {
      if (tooltip) {
        tooltip.hide();
        button.removeAttribute("data-bs-title");
        button.removeAttribute("data-bs-toggle");
        button.removeAttribute("data-bs-placement");
      }
      button.setAttribute("title", currentTitle);
      button.classList.remove('code-copy-button-checked');
    }, 1000);
    // clear code selection
    e.clearSelection();
  });
    var localhostRegex = new RegExp(/^(?:http|https):\/\/localhost\:?[0-9]*\//);
    var mailtoRegex = new RegExp(/^mailto:/);
      var filterRegex = new RegExp("https:\/\/zhujiedong\.github\.io\/photosynthesis-analysis\/");
    var isInternal = (href) => {
        return filterRegex.test(href) || localhostRegex.test(href) || mailtoRegex.test(href);
    }
    // Inspect non-navigation links and adorn them if external
 	var links = window.document.querySelectorAll('a[href]:not(.nav-link):not(.navbar-brand):not(.toc-action):not(.sidebar-link):not(.sidebar-item-toggle):not(.pagination-link):not(.no-external):not([aria-hidden]):not(.dropdown-item):not(.quarto-navigation-tool)');
    for (var i=0; i<links.length; i++) {
      const link = links[i];
      if (!isInternal(link.href)) {
        // undo the damage that might have been done by quarto-nav.js in the case of
        // links that we want to consider external
        if (link.dataset.originalHref !== undefined) {
          link.href = link.dataset.originalHref;
        }
      }
    }
  function tippyHover(el, contentFn, onTriggerFn, onUntriggerFn) {
    const config = {
      allowHTML: true,
      maxWidth: 500,
      delay: 100,
      arrow: false,
      appendTo: function(el) {
          return el.parentElement;
      },
      interactive: true,
      interactiveBorder: 10,
      theme: 'quarto',
      placement: 'bottom-start',
    };
    if (contentFn) {
      config.content = contentFn;
    }
    if (onTriggerFn) {
      config.onTrigger = onTriggerFn;
    }
    if (onUntriggerFn) {
      config.onUntrigger = onUntriggerFn;
    }
    window.tippy(el, config); 
  }
  const noterefs = window.document.querySelectorAll('a[role="doc-noteref"]');
  for (var i=0; i<noterefs.length; i++) {
    const ref = noterefs[i];
    tippyHover(ref, function() {
      // use id or data attribute instead here
      let href = ref.getAttribute('data-footnote-href') || ref.getAttribute('href');
      try { href = new URL(href).hash; } catch {}
      const id = href.replace(/^#\/?/, "");
      const note = window.document.getElementById(id);
      if (note) {
        return note.innerHTML;
      } else {
        return "";
      }
    });
  }
  const xrefs = window.document.querySelectorAll('a.quarto-xref');
  const processXRef = (id, note) => {
    // Strip column container classes
    const stripColumnClz = (el) => {
      el.classList.remove("page-full", "page-columns");
      if (el.children) {
        for (const child of el.children) {
          stripColumnClz(child);
        }
      }
    }
    stripColumnClz(note)
    if (id === null || id.startsWith('sec-')) {
      // Special case sections, only their first couple elements
      const container = document.createElement("div");
      if (note.children && note.children.length > 2) {
        container.appendChild(note.children[0].cloneNode(true));
        for (let i = 1; i < note.children.length; i++) {
          const child = note.children[i];
          if (child.tagName === "P" && child.innerText === "") {
            continue;
          } else {
            container.appendChild(child.cloneNode(true));
            break;
          }
        }
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(container);
        }
        return container.innerHTML
      } else {
        if (window.Quarto?.typesetMath) {
          window.Quarto.typesetMath(note);
        }
        return note.innerHTML;
      }
    } else {
      // Remove any anchor links if they are present
      const anchorLink = note.querySelector('a.anchorjs-link');
      if (anchorLink) {
        anchorLink.remove();
      }
      if (window.Quarto?.typesetMath) {
        window.Quarto.typesetMath(note);
      }
      // TODO in 1.5, we should make sure this works without a callout special case
      if (note.classList.contains("callout")) {
        return note.outerHTML;
      } else {
        return note.innerHTML;
      }
    }
  }
  for (var i=0; i<xrefs.length; i++) {
    const xref = xrefs[i];
    tippyHover(xref, undefined, function(instance) {
      instance.disable();
      let url = xref.getAttribute('href');
      let hash = undefined; 
      if (url.startsWith('#')) {
        hash = url;
      } else {
        try { hash = new URL(url).hash; } catch {}
      }
      if (hash) {
        const id = hash.replace(/^#\/?/, "");
        const note = window.document.getElementById(id);
        if (note !== null) {
          try {
            const html = processXRef(id, note.cloneNode(true));
            instance.setContent(html);
          } finally {
            instance.enable();
            instance.show();
          }
        } else {
          // See if we can fetch this
          fetch(url.split('#')[0])
          .then(res => res.text())
          .then(html => {
            const parser = new DOMParser();
            const htmlDoc = parser.parseFromString(html, "text/html");
            const note = htmlDoc.getElementById(id);
            if (note !== null) {
              const html = processXRef(id, note);
              instance.setContent(html);
            } 
          }).finally(() => {
            instance.enable();
            instance.show();
          });
        }
      } else {
        // See if we can fetch a full url (with no hash to target)
        // This is a special case and we should probably do some content thinning / targeting
        fetch(url)
        .then(res => res.text())
        .then(html => {
          const parser = new DOMParser();
          const htmlDoc = parser.parseFromString(html, "text/html");
          const note = htmlDoc.querySelector('main.content');
          if (note !== null) {
            // This should only happen for chapter cross references
            // (since there is no id in the URL)
            // remove the first header
            if (note.children.length > 0 && note.children[0].tagName === "HEADER") {
              note.children[0].remove();
            }
            const html = processXRef(null, note);
            instance.setContent(html);
          } 
        }).finally(() => {
          instance.enable();
          instance.show();
        });
      }
    }, function(instance) {
    });
  }
      let selectedAnnoteEl;
      const selectorForAnnotation = ( cell, annotation) => {
        let cellAttr = 'data-code-cell="' + cell + '"';
        let lineAttr = 'data-code-annotation="' +  annotation + '"';
        const selector = 'span[' + cellAttr + '][' + lineAttr + ']';
        return selector;
      }
      const selectCodeLines = (annoteEl) => {
        const doc = window.document;
        const targetCell = annoteEl.getAttribute("data-target-cell");
        const targetAnnotation = annoteEl.getAttribute("data-target-annotation");
        const annoteSpan = window.document.querySelector(selectorForAnnotation(targetCell, targetAnnotation));
        const lines = annoteSpan.getAttribute("data-code-lines").split(",");
        const lineIds = lines.map((line) => {
          return targetCell + "-" + line;
        })
        let top = null;
        let height = null;
        let parent = null;
        if (lineIds.length > 0) {
            //compute the position of the single el (top and bottom and make a div)
            const el = window.document.getElementById(lineIds[0]);
            top = el.offsetTop;
            height = el.offsetHeight;
            parent = el.parentElement.parentElement;
          if (lineIds.length > 1) {
            const lastEl = window.document.getElementById(lineIds[lineIds.length - 1]);
            const bottom = lastEl.offsetTop + lastEl.offsetHeight;
            height = bottom - top;
          }
          if (top !== null && height !== null && parent !== null) {
            // cook up a div (if necessary) and position it 
            let div = window.document.getElementById("code-annotation-line-highlight");
            if (div === null) {
              div = window.document.createElement("div");
              div.setAttribute("id", "code-annotation-line-highlight");
              div.style.position = 'absolute';
              parent.appendChild(div);
            }
            div.style.top = top - 2 + "px";
            div.style.height = height + 4 + "px";
            div.style.left = 0;
            let gutterDiv = window.document.getElementById("code-annotation-line-highlight-gutter");
            if (gutterDiv === null) {
              gutterDiv = window.document.createElement("div");
              gutterDiv.setAttribute("id", "code-annotation-line-highlight-gutter");
              gutterDiv.style.position = 'absolute';
              const codeCell = window.document.getElementById(targetCell);
              const gutter = codeCell.querySelector('.code-annotation-gutter');
              gutter.appendChild(gutterDiv);
            }
            gutterDiv.style.top = top - 2 + "px";
            gutterDiv.style.height = height + 4 + "px";
          }
          selectedAnnoteEl = annoteEl;
        }
      };
      const unselectCodeLines = () => {
        const elementsIds = ["code-annotation-line-highlight", "code-annotation-line-highlight-gutter"];
        elementsIds.forEach((elId) => {
          const div = window.document.getElementById(elId);
          if (div) {
            div.remove();
          }
        });
        selectedAnnoteEl = undefined;
      };
        // Handle positioning of the toggle
    window.addEventListener(
      "resize",
      throttle(() => {
        elRect = undefined;
        if (selectedAnnoteEl) {
          selectCodeLines(selectedAnnoteEl);
        }
      }, 10)
    );
    function throttle(fn, ms) {
    let throttle = false;
    let timer;
      return (...args) => {
        if(!throttle) { // first call gets through
            fn.apply(this, args);
            throttle = true;
        } else { // all the others get throttled
            if(timer) clearTimeout(timer); // cancel #2
            timer = setTimeout(() => {
              fn.apply(this, args);
              timer = throttle = false;
            }, ms);
        }
      };
    }
      // Attach click handler to the DT
      const annoteDls = window.document.querySelectorAll('dt[data-target-cell]');
      for (const annoteDlNode of annoteDls) {
        annoteDlNode.addEventListener('click', (event) => {
          const clickedEl = event.target;
          if (clickedEl !== selectedAnnoteEl) {
            unselectCodeLines();
            const activeEl = window.document.querySelector('dt[data-target-cell].code-annotation-active');
            if (activeEl) {
              activeEl.classList.remove('code-annotation-active');
            }
            selectCodeLines(clickedEl);
            clickedEl.classList.add('code-annotation-active');
          } else {
            // Unselect the line
            unselectCodeLines();
            clickedEl.classList.remove('code-annotation-active');
          }
        });
      }
  const findCites = (el) => {
    const parentEl = el.parentElement;
    if (parentEl) {
      const cites = parentEl.dataset.cites;
      if (cites) {
        return {
          el,
          cites: cites.split(' ')
        };
      } else {
        return findCites(el.parentElement)
      }
    } else {
      return undefined;
    }
  };
  var bibliorefs = window.document.querySelectorAll('a[role="doc-biblioref"]');
  for (var i=0; i<bibliorefs.length; i++) {
    const ref = bibliorefs[i];
    const citeInfo = findCites(ref);
    if (citeInfo) {
      tippyHover(citeInfo.el, function() {
        var popup = window.document.createElement('div');
        citeInfo.cites.forEach(function(cite) {
          var citeDiv = window.document.createElement('div');
          citeDiv.classList.add('hanging-indent');
          citeDiv.classList.add('csl-entry');
          var biblioDiv = window.document.getElementById('ref-' + cite);
          if (biblioDiv) {
            citeDiv.innerHTML = biblioDiv.innerHTML;
          }
          popup.appendChild(citeDiv);
        });
        return popup.innerHTML;
      });
    }
  }
});
</script><nav class="page-navigation"><div class="nav-page nav-page-previous">
      <a href="./gm-gs.html" class="pagination-link" aria-label="叶肉与气孔导度">
        <i class="bi bi-arrow-left-short"></i> <span class="nav-page-text">叶肉与气孔导度</span>
      </a>          
  </div>
  <div class="nav-page nav-page-next">
      <a href="./gm.html" class="pagination-link" aria-label="叶肉导度计算">
        <span class="nav-page-text"><span class="chapter-number">23</span>&nbsp; <span class="chapter-title">叶肉导度计算</span></span> <i class="bi bi-arrow-right-short"></i>
      </a>
  </div>
</nav>
</div> <!-- /content -->



<footer class="footer"><div class="nav-footer"><div class="nav-footer-center"><div class="toc-actions d-sm-block d-md-none"><ul><li><a href="https://github.com/zhujiedong/photosynthesis-analysis/edit/master/gs.qmd" class="toc-action"><i class="bi bi-github"></i>Edit this page</a></li></ul></div></div></div></footer></body></html>